package com.example.fucc.myapplication.model.util;


import com.example.fucc.myapplication.model.exception.ApiException;

import io.reactivex.subscribers.ResourceSubscriber;

public abstract class CommonSubscriber<T> extends ResourceSubscriber<T> {
    @Override
    public void onError(Throwable e) {

        if (e instanceof ApiException) {
            if (((ApiException) e).getCode() == 0) {
                onFail();
            }
        }

    }

    public void onFail() {
    }

}